<?xml version = '1.0' encoding = 'UTF-8'?>
<HBRRepo><variables/><rulesets/><rules><rule id="1" name="Balance Sheet and Cash Flow - Actual" product="Planning"><property name="application">Vision</property><property name="plantype">Plan1</property><property name="display_label">Balance Sheet and Cash Flow - Actual</property><property name="enablePostProcessing">false</property><property name="enablePreProcessing">false</property><script type="calcscript">SET AGGMISSG ON;
SET UPDATECALC OFF;

FIX (&amp;StartYr1,"Actual","Working")
	FIX ("000","P_000")
    "1260"(
      IF (@ISDESC("YearTotal") AND NOT @ISMBR("Jan"))
         "1260" = @PRIOR("1260"->"000"->"P_000")  -  "7730";
      ENDIF
    )
    "1610"(
      IF (@ISDESC("YearTotal"))
        "1610" = @PRIOR("1610") - "7310"->"TD"->"P_TP";
      ENDIF
    )
    "1620"(
      IF (@ISDESC("YearTotal"))
        "1620" = @PRIOR("1620") - "7320"->"TD"->"P_TP";
      ENDIF
    )
    "1630"(
      IF (@ISDESC("YearTotal"))
        "1630" = @PRIOR("1630") - "7330"->"TD"->"P_TP";
      ENDIF
    )
    "1640"(
      IF (@ISDESC("YearTotal"))
        "1640" = @PRIOR("1640") - "7340"->"TD"->"P_TP";
      ENDIF
    )
    "1650"(
      IF (@ISDESC("YearTotal"))
        "1650" = @PRIOR("1650") - "7350"->"TD"->"P_TP";
      ENDIF
    )
    "1660"(
      IF (@ISDESC("YearTotal"))
        "1660" = @PRIOR("1660") - "7360"->"TD"->"P_TP";
      ENDIF
    )
    "1665"(
      IF (@ISDESC("YearTotal"))
        "1665" = @PRIOR("1665") - "7365"->"TD"->"P_TP";
      ENDIF
    )
    "3310"(
      IF (@ISMBR("Jan"))
        "3310" = "3310"->"BegBalance";
        "3320" = "NI"->"TD"->"P_TP";
      ELSEIF (NOT @ISMBR("Jan") AND @ISDESC("YearTotal"))
        "3310" = @PRIOR("3310");
        "3320" = @PRIOR("3320") + "NI"->"TD"->"P_TP";
      ENDIF
    )
    CLEARDATA "1110";
    CALC DIM ("Account");
	    "1110" = "TLOE" - "1001";
    ENDFIX
    CALC DIM ("Account","Entity","Product");
ENDFIX

/* Loop 4 times for each year */
LOOP (4)
FIX ("Actual","Working",&amp;StartYr2:&amp;CurYr)
	FIX ("000","P_000")
  "BegBalance"(
    IF (@ISDESC("BS"))
      "BegBalance" = @MDSHIFT(@CURRMBR("Account")->"Dec"->"Actual"->"Working",-1,"Year",);
      "3310"->"BegBalance" = "3310"->"BegBalance" + "3320"->"BegBalance";
      "3320"->"BegBalance" = #missing;
    ENDIF
  )
    "1260"(
      IF (@ISDESC("YearTotal") AND NOT @ISMBR("Jan"))
         "1260" = @PRIOR("1260"->"000"->"P_000")  -  "7730";
      ENDIF
    ) "1610"(
      IF (@ISDESC("YearTotal"))
        "1610" = @PRIOR("1610") - "7310"->"TD"->"P_TP";
      ENDIF
    )
    "1620"(
      IF (@ISDESC("YearTotal"))
        "1620" = @PRIOR("1620") - "7320"->"TD"->"P_TP";
      ENDIF
    )
    "1630"(
      IF (@ISDESC("YearTotal"))
        "1630" = @PRIOR("1630") - "7330"->"TD"->"P_TP";
      ENDIF
    )
    "1640"(
      IF (@ISDESC("YearTotal"))
        "1640" = @PRIOR("1640") - "7340"->"TD"->"P_TP";
      ENDIF
    )
    "1650"(
      IF (@ISDESC("YearTotal"))
        "1650" = @PRIOR("1650") - "7350"->"TD"->"P_TP";
      ENDIF
    )
    "1660"(
      IF (@ISDESC("YearTotal"))
        "1660" = @PRIOR("1660") - "7360"->"TD"->"P_TP";
      ENDIF
    )
    "1665"(
      IF (@ISDESC("YearTotal"))
        "1665" = @PRIOR("1665") - "7365"->"TD"->"P_TP";
      ENDIF
    )
    "1260"(
      IF (@ISDESC("YearTotal"))
			"1260" = @PRIOR("1260") - "7730"->"TD"->"P_TP";
      ENDIF
    )
    "3310"(
      IF (@ISMBR("Jan"))
        "3310" = "3310"->"BegBalance";
        "3320" = "NI"->"TD"->"P_TP";
      ELSEIF (NOT @ISMBR("Jan") AND @ISDESC("YearTotal"))
        "3310" = @PRIOR("3310");
        "3320" = @PRIOR("3320") + "NI"->"TD"->"P_TP";
      ENDIF
    )
    CLEARDATA "1110";
    CALC DIM ("Account");
	    "1110" = "TLOE" - "1001";
	ENDFIX
		@IDESCENDANTS("BS");
		FIX (@IDESCENDANTS("BS"))
	       CALC DIM ("Entity","Product");
		ENDFIX
ENDFIX
ENDLOOP


FIX ("Actual","Working",&amp;CurYr)
	FIX ("000","P_000")
	FIX ("Jul":"Dec")
		CLEARDATA "7730";
	ENDFIX
    "3310"(
      IF (NOT @ISMBR("Jan") AND @ISDESC("YearTotal"))
        "3310" = @PRIOR("3310");
        "3320" = @PRIOR("3320") + "NI"->"TD"->"P_TP";
      ENDIF
    )
    CLEARDATA "1110";
    CALC DIM ("Account");
	    "1110" = "TLOE" - "1001";
	ENDFIX
		@IDESCENDANTS("BS");
		FIX (@IDESCENDANTS("BS"))
	    CALC DIM ("Entity","Product");
		ENDFIX
ENDFIX

FIX ("Actual","Working","Jul":"Dec",@IDESCENDANTS("BS"))
	CLEARDATA &amp;CurYr;
ENDFIX

FIX (&amp;StartYr:&amp;LastYr,"Actual","Working")
  FIX ("000","P_000")
    "Change in Accounts Receivable"(
      IF (@ISDESC("YearTotal"))
        "Change in Accounts Receivable" = @PRIOR("1200") - "1200";
        "Change in Inventory" = @PRIOR("1400") - "1400";
        "Change in Prepaid" = @PRIOR("1300") - "1300";
        "Change in Accounts Payable" = "2210" - @PRIOR("2210");
        "Change in Other Accrued Liabilities" = "Accrued Liabilities Total" - @PRIOR("Accrued Liabilities Total");
        "Capital Equipment Purchases" = @PRIOR("1500") - "1500";
        "Changes in Other Assets" = @PRIOR("1700") - "1700";
        "Increase or Decrease in Long Term Debt" = "2999" - @PRIOR("2999");
        "Issuance or Repurchase of Common Stock" = "3100" - @PRIOR("3100");
        "Changes in Other Equity" = "Other Equity Total" - @PRIOR("Other Equity Total");
        "Cash Beginning Balance" = @PRIOR("1100");
      ENDIF
    )
  ENDFIX
	@IDESCENDANTS("CF");
	FIX (@IDESCENDANTS("CF"))
	  CALC DIM ("Entity","Product");
	ENDFIX
ENDFIX

FIX (&amp;CurYr,"Actual","Working")
  FIX ("Jan":"Jun","000","P_000")
    "Change in Accounts Receivable"(
      IF (@ISDESC("YearTotal"))
        "Change in Accounts Receivable" = @PRIOR("1200") - "1200";
        "Change in Inventory" = @PRIOR("1400") - "1400";
        "Change in Prepaid" = @PRIOR("1300") - "1300";
        "Change in Accounts Payable" = "2210" - @PRIOR("2210");
        "Change in Other Accrued Liabilities" = "Accrued Liabilities Total" - @PRIOR("Accrued Liabilities Total");
        "Capital Equipment Purchases" = @PRIOR("1500") - "1500";
        "Changes in Other Assets" = @PRIOR("1700") - "1700";
        "Increase or Decrease in Long Term Debt" = "2999" - @PRIOR("2999");
        "Issuance or Repurchase of Common Stock" = "3100" - @PRIOR("3100");
        "Changes in Other Equity" = "Other Equity Total" - @PRIOR("Other Equity Total");
        "Cash Beginning Balance" = @PRIOR("1100");
      ENDIF
    )
  ENDFIX
	@IDESCENDANTS("CF");
	FIX (@IDESCENDANTS("CF"))
	  CALC DIM ("Entity");
	ENDFIX
ENDFIX
</script></rule></rules><components/><deployobjects><deployobject product="2" application="vision" plantype="plan1" obj_id="1" obj_type="1" name="BALANCE SHEET AND CASH FLOW - ACTUAL"/></deployobjects></HBRRepo>